This repository was archived by the owner on Sep 9, 2024. It is now read-only.
feat: Gitea backend refactoring#833
Merged
KaneFreeman merged 4 commits intoStaticJsCMS:nextfrom Jun 6, 2023
Merged
Conversation
✅ Deploy Preview for staticjscms ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for demo-staticjscms ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Codecov Report
@@ Coverage Diff @@
## next #833 +/- ##
==========================================
+ Coverage 51.56% 51.67% +0.10%
==========================================
Files 218 218
Lines 9254 9264 +10
Branches 2440 2442 +2
==========================================
+ Hits 4772 4787 +15
+ Misses 4135 4130 -5
Partials 347 347
|
KaneFreeman
approved these changes
Jun 6, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
With go-gitea/gitea#24887 and go-gitea/gitea#25033 being merged, the two major issues with the Gitea backend can finally be resolved:
Authorization: Up until now, Gitea didn't support PKCE auth. As Netlify doesn't support Gitea, users were required to setup an external OAuth provider (e. g. https://github.com/denyskon/teabag). With Allow for PKCE flow without client secret + add docs go-gitea/gitea#25033, Gitea now supports PKCE auth, which allows for simple and secure client-side authorization without using an OAuth provider.
-> refactor authentication to use PKCE
Multiple-file commits: As above, modifying or creating multiple files wasn't possible using Gitea's API. With API endpoint for changing/creating/deleting multiple files go-gitea/gitea#24887, a new API endpoint was added which provides this functionality. The original behavior caused a lot of problems (too many commits for multiple files -> too many CI runs -> high server load, entries appearing before the included media....)
-> refactor file saving/deletion to use new API endpoint
These changes are a big quality improvement for the backend and a step towards bringing it out of beta.
Consequences
This refactoring counts as breaking for two reasons:
API endpoints: some of the endpoints used by the backend starting from now will only be available since Gitea 1.20, which is expected to be released around the 1st of July 2023. Older Gitea versions won't work.
Config: the backend config slightly changes because of the switch to PKCE auth. Users will need to update their config accordingly to the docs.
To Do
The breaking changes need to be documented in a migration guide for Static CMS v3.0 or the release notes.
Other
With this change, the Gitea backend no longer depends on third-party infrastructure beside the Gitea instance, allowing for testing using the official test instance provided by the Gitea project.